package model;

import java.io.Serializable;

/**
 * Bank Control
 * 
 * Class for taking care of the Bank
 * creates new Bank
 * sets startMoney for Player and Bank
 * @author wsiebert
 */

public class Bank implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private int startMoneyPlayer;
	private int startMoneyBank;
	private int minMoney;
	boolean bankIsInsolvent;
	private static int MoneyBank;

	public Bank()
	{
		MoneyBank = startMoneyBank;
		startMoneyBank = 200000;
		startMoneyPlayer = 30000;
		minMoney = 0;
		bankIsInsolvent = false;
	}

	
	/**
	 * Method to get the current Money of the Bank 
	 * @return MoneyBank The current Money of the Bank
	 */
	public int getMoneyBank()
	{
		return MoneyBank;
	}
	
	/**
	 * Method to set the current Money of the Bank
	 * If the Bank is insolvent, bankIsInsolvent is true 
	 * @param newValue The new value of the Bank
	 */
	public void setMoneyBank(int newValue)
	{
		MoneyBank = newValue;
		if(MoneyBank <= minMoney) 
		{
			bankIsInsolvent = true;
		}
	}
	/**
	 * Method to get the StartMoney of a Player
	 * @return startMoneyPlayer The start Money of a Player
	 */
	public int setStartMoneyPlayer()
	{
		return startMoneyPlayer;
	}
}
